{% extends 'cms/base.html' %}

{% block title %}
退货单
{% endblock %}
{% block js %}
{% endblock %}
{% block content %}

    <div class="row">
        <div class="col-md-12">
            <!-- RECENT PURCHASES -->
            <div class="panel">
                <div class="panel-heading" style="max-height: 130px">
                    <h3 class="panel-title"><strong>退货单</strong></h3>


                </div>
                <form>
                    <input type="text" value="{{ orderNum }}" name="ordernum" style="display: none">
                </form>
                <div class="panel-body no-padding" style="overflow-x: auto;overflow-y: auto;height: 450px">
                    <table class="table table-striped">
                        <thead>
                            <tr>
                                <th>订单号</th>
                                <th>书号</th>
                                <th>书名</th>
                                <th>售价</th>
                                <th>退货数</th>
                            </tr>
                        </thead>
                        <tbody>
                        {% for item in result %}
                            <tr>
                                <td>{{ orderNum }}</td>
                                <td>{{ item[0] }}</td>
                                <td>{{ item[1]|truncate(20, '...') }}</td>
                                <td>{{ item[2] }}</td>
                                <td>{{ returnNum[loop.index0] }}</td>
                            </tr>
                        {% endfor %}

                        </tbody>
                    </table>
                </div>
                <div class="panel-footer">
                    <div class="row">
                        <div class="col-md-6">
                            <span class="panel-note" style="margin-left: 20px; font-size: medium"><strong>签名：</strong>{{ sign }}</span>
                        <span class="panel-note" style="margin-left: 20px; font-size: medium"><strong>退货总额：</strong>¥{{ returnAmount }}</span>
                        </div>
                        <div class="col-md-6 text-right">

                            <a href="{{ url_for('cms.printReturnReport') }}" class="btn btn-primary"> 打印退货单</a>

                        </div>
                    </div>
                </div>


            </div>
            <!-- END RECENT PURCHASES -->
        </div>

    </div>

{% endblock %}
